import {
	request,
} from '@/api/request';
const apiList = [{
		// /api/goods/getType
		name: 'getType',
		url: '/api/goods/getType',
		method:'GET'
	},{
		// /api/goods/index
		name: 'goodsindex',
		url: '/api/goods/index'
	},
	{
		// /api/goods/detail
		name: 'goodsdetail',
		url: '/api/goods/detail',
		method:'GET'
	}
	
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token
	})
	return mode
}, {})